package StudyCode.summary.Basic.myint;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class PalindromeNumber {
	public static void main(String[] args) {
		int numbers[] = new int[]{121, 23, 21, 11, 67, 44};
		for (int number1 : numbers) {
			int number = number1;
			int reversedNumber = 0;
			int temp = 0;

			// 反转数字
			while (number > 0) {
				temp = number % 10;
				number = number / 10;
				reversedNumber = reversedNumber * 10 + temp;
			}

			if (number1 == reversedNumber)
				System.out.println(number1 + " 是回文数");
			else
				System.out.println(number1 + " 不是回文数");
		}

	}
}
